#include <STC15F2K60S2.H>
#include "smg.h"

unsigned char Number;

void Timer2_Init(void)		//1毫秒@11.0592MHz
{
	AUXR &= 0xFB;		//定时器时钟12T模式
	T2L = 0x18;		//设置定时初始值
	T2H = 0xFC;		//设置定时初始值
	AUXR |= 0x10;	//定时器2开始计时
	IE2  |= 0x04;	//打开定时器2的中断
	EA = 1;			//打开总中断
}

void main()
{
	All_Init();
	Timer2_Init();
	while(1)
	{
		Nixie(1, Number/10);
		Nixie(2, Number%10);
	}
}

//定时器2 中断服务函数模板
//12T 16位自动重载
void Timer2_Routine() interrupt 12 using 1
{
    static unsigned int T2Count0;	
	T2Count0++;	
	if(T2Count0 >= 1000)
	{
		Number++;
		T2Count0 = 0;
	}
}

